﻿using System;
using System.Diagnostics;

namespace VDIMonitorService
{
    internal static class Logger
    {
        private const string EVENTLOGSOURCENAME = "VdiMonitorService";

        public static void LogInfo(string message)
        {
            EventLog.WriteEntry(EVENTLOGSOURCENAME, message, EventLogEntryType.Information, 10000);
        }

        public static void RecordUserLogoff(string message)
        {
            EventLog.WriteEntry(EVENTLOGSOURCENAME, message, EventLogEntryType.Information, 10001);
        }

        public static void LogException(Exception e)
        {
            EventLog.WriteEntry(EVENTLOGSOURCENAME, e.Message + "\r\n" + e.StackTrace, EventLogEntryType.Error, 100);
        }
    }
}